import React from 'react'
import { BrowserRouter, Switch, Route, } from 'react-router-dom'
import Index from '@/page/Index/Index'
import Login from '@/page/Login/Login'
import User from '@/page/User/User'
import Demo from '@/page/Demo/Demo'
import Test from '@/page/Test/Test'
import NotFound from '@/page/NotFound/NotFound'
import TopicList from '@/page/Topic/List/List'
import TopicDetail from '@/page/Topic/Detail/Detail'
import TopicCreate from '@/page/Topic/Create/Create'
import ShoppingCartIndex from '@/page/ShoppingCart/Index'

class Routers extends React.Component {
  render() {
    return (
      <BrowserRouter>
        <Switch>
          <Route exact path="/" component={Index} />
          <Route path="/login" component={Login} />
          <Route path="/user" component={User} />
          <Route path="/demo" component={Demo} />
          <Route path="/test" component={Test} />
          <Route exact path="/topic" component={TopicList} />
          <Route path="/topic/:id" component={TopicDetail} />
          <Route path="/topicCreate" component={TopicCreate} />
          <Route path="/shoppingCart" component={ShoppingCartIndex} />
          <Route path="*" component={NotFound} />
        </Switch>
      </BrowserRouter>
    )
  }
}

export default Routers
